package com.tedu.bill1;

/**
 * Author：毕龙
 * Date: 2024/4/11 19:47
 */
public class TestReferenceTransfor {
    public static void main(String[] args) {
        Student stu1 = new Student(18, "恒博", "男");
        Student stu2 = stu1;
        stu2.sex = "女";
        stu1.print();

        addAge(stu1);
        stu1.print();


        System.out.println("====================");
        System.out.println(stu1 == stu2);
        stu2 = new Student();
        System.out.println(stu1 == stu2);

    }

    public static void addAge(Student stu){
        stu.age += 1;
    }
}
